<div matDialogTitle><mat-icon svgIcon="account"></mat-icon> <span>Login</span></div>

<form #loginForm="ngForm" novalidate (submit)="login()">
  <div mat-dialog-content>
    <mat-form-field>
      <input
        matInput
        placeholder="User"
        [(ngModel)]="user"
        name="user"
        required
        autocomplete="username"
      />
    </mat-form-field>
    <mat-form-field>
      <input
        type="password"
        matInput
        placeholder="Password"
        autocomplete="current-password"
        [(ngModel)]="password"
        name="password"
        required
      />
    </mat-form-field>

    <div *ngIf="errorMessage" class="mat-input-error">{{ errorMessage }}</div>
  </div>
  <div mat-dialog-actions>
    <button mat-button type="submit" [disabled]="!loginForm.form.valid">Login</button>
  </div>
</form>
